package com.example.string;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author hej
 * @date 2023/6/17 17:45
 */
public class SplitLast {
    public static void main(String[] args) {
        List<String> ss = new ArrayList<>();
        ss.add("111");
        ss.add("222");
        for(int i=0; i< ss.size(); i++){
            ss.set(i, ss.get(i) + 1);
        }
        System.out.println(ss);

        System.out.println(getReplaceStr("1-10017R"));
    }

    private static String getReplaceStr(String trackNo){
        List<String> replaceStr = Arrays.asList("R","L");
        if(replaceStr.contains(trackNo.substring(trackNo.length()-1))){
            return trackNo.substring(0,trackNo.length() - 1);
        }
        return trackNo;
    }
}
